# coding:utf-8

name = 'dewei'


def test():
    print(name)


test()  # dewei


def test1():
    name = '小慕'
    print('函数内', name)


test1()  # 函数内 小慕
print('函数外', name)  # 函数外 dewei


def test3():
    age = 33
    print(age)


test3()  # 33


# print(age)  # NameError: name 'age' is not defined


def test4(a):
    a = 10


test4(name)
print(name)  # dewei

print('=========')


def test5():
    global name  # 全局变量
    name = 10  # 修改了全局变量的值


test5()
print(name)  # 10

test_dict = {'a': 1, 'b': 2}


def test6():
    test_dict['c'] = 3
    test_dict.pop('a')


test6()
print(test_dict)
